package com.hdey.service.chao.impl;

import com.alibaba.druid.util.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdey.mapper.chao.KeShiMapper;
import com.hdey.pojo.chao.Keshi;
import com.hdey.service.chao.KeshiService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service("keshiService")
@Transactional
public class KeshiServiceImpl extends ServiceImpl<KeShiMapper, Keshi> implements KeshiService {

    @Resource
    private KeShiMapper keShiMapper;


    @Override
    public Page<Keshi> searchPage(Integer current, Integer size, String departmentName) {
        Page<Keshi> page=new Page<>(current,size);
        LambdaQueryWrapper<Keshi> wrapper=new LambdaQueryWrapper<>();
        wrapper.like(!StringUtils.isEmpty(departmentName), Keshi::getDepartmentName,departmentName);
        //wrapper.eq(wuzi.getDictionaryId()!=null,Wuzi::getDictionaryId,wuzi.getDictionaryId());
        keShiMapper.selectPage(page,wrapper);
        return page;
    }




}
